Tuesday, September 28, 2004

ODBC.NET Data Provider

The ODBC.NET Data Provider is a native component to the .NET Framework version 1.1. This component provides access to native ODBC drivers in the same way that the OLE DB .NET Data Provider provides access to native OLE DB providers.The ODBC.NET Data Provider is intended to work with all compliant ODBC drivers like eg.

* Microsoft SQL ODBC Driver
* Microsoft ODBC Driver for Oracle
* Microsoft Jet ODBC Driver

Unlike the ODBC .NET data provider addon for .NET Framework 1.0, the namespace for this version changed from Microsoft.Data.Odbc to System.Data.Odbc. The Connection strings will be as follows for different data sources.

The connection string for a SQL Server database looks like following:
DRIVER={SQL Server};SERVER=TigerServer;UID=sa;PWD=;DATABASE=northwind;

The connection string for an Oracle database looks like following:
Driver={Microsoft ODBC for Oracle};Server=ORACLE8i;UID=User1;PWD=xxxx

The connection string for a Microsoft Access database looks like following:
Driver={Microsoft Access Driver (*.mdb)};DBQ=D:\Northwind.mdb

The connection string for an Excel database looks like following:
Driver={Microsoft Excel Driver (*.xls)};DBQ=C:\ExcelFile1.xls

The connection string for a text database looks like following:
Driver={Microsoft Text Driver (*.txt; *.csv)};DBQ=C:\TextFile1.txt


With Best Regards,
Mitesh Mehta
Email : miteshvmehta@gmail.com
http://cc.1asphost.com/miteshvmehta/

0 Comments:

Post a Comment

<< Home